import 'package:flutter/material.dart';

class Test_Scaffold extends StatelessWidget {
  const Test_Scaffold({super.key});

  @override
  Widget build(BuildContext context) {
    return //最小可用结构
        Scaffold(
      appBar: AppBar(title: Text('首页')),
      body: Center(child: Text('主体内容')),
      drawer: Drawer(
        child: ListView(
          children: [
            DrawerHeader(child: Text('用户信息')),
            ListTile(title: Text('个人中心'), leading: Icon(Icons.person)),
            ListTile(title: Text('设置'), leading: Icon(Icons.settings))
          ],
        ),
      ),
      endDrawer: Drawer(
        child: ListView(
          children: [
            DrawerHeader(child: Text('用户信息')),
            ListTile(title: Text('个人中心'), leading: Icon(Icons.person)),
            ListTile(title: Text('设置'), leading: Icon(Icons.settings))
          ],
        ),
      ),
      bottomNavigationBar: BottomNavigationBar(currentIndex: 0, items: [
        BottomNavigationBarItem(icon: Icon(Icons.home), label: '首页'),
        BottomNavigationBarItem(icon: Icon(Icons.settings), label: '设置'),
      ]),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () => showModalBottomSheet(
          context: context,
          builder: (ctx) => Container(
            width: double.infinity,
            height: 200,
            alignment: Alignment.center,
            child: Text('新建内容'),
          ),
        ),
      ),
      bottomSheet: Container(
        height: 40,
        color: Colors.grey[200],
        child: Center(child: Text('持久性信息栏')),
      ),
          
    );
  }
}

//最小可用结构
// Scaffold(
// appBar: AppBar(title: Text('首页')),
// body: Center(child: Text('主体内容')),
// )

////完整布局
// Scaffold(
//   appBar: buildAppBar(context),
//   drawer: buildDrawer(),
//   body: buildBody(),
//   bottomNavigationBar: buildBottomNavigationBar(),
//   floatingActionButton: buildFloatingActionButton(context),
//   bottomSheet: buildContainer(),
// )
//

//
// Drawer buildDrawer() {
//   return Drawer(
//     child: ListView(
//       children: [
//         DrawerHeader(child: Text('用户信息')),
//         ListTile(title: Text('个人中心'), leading: Icon(Icons.person)),
//         ListTile(title: Text('设置'), leading: Icon(Icons.settings))
//       ],
//     ),
//   );
// }
